@extends('layout.adminlayout')
@section('css')
 <script src="/admin/js/metisMenu.min.js"></script>
 <script src="/admin/js/custom.js"></script>
 <link href="/admin/css/custom.css" rel="stylesheet">
@endsection
@section('content')
     <div class="tables"> 
      <div class="table-responsive bs-example widget-shadow"> 
       <h4 style="margin-bottom: 15px;">房间列表:</h4> 
       <form action="/admin/room/index" method="get">
        <div class="row" style="padding-bottom: 15px;margin-top: 0px;"> 
         <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px;float:left;top: 5px;">代理商：</p> 
         <select name="ag" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD;margin: 5px 10px;width: 64%;float: right;">
          <option value="">请选择代理商</option>
          @foreach($agent as $v)
           <option value="{{$v['id']}}"
                   @if($get['ag'] == $v['id'])
                   selected
                   @else
                   @if(Cookie::get('agentId') == $v['id'])
                   selected
                   @endif
                   @endif>{!! $v['agent_name'] !!}</option>
          @endforeach
         </select>
         <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px;float:left;top: 7px;"> 房间：</p> 
         <input type="text" name="room" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD; margin: 0px 10px;width: 64%;float: right;" value="{{$get['room']}}"/>
         <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px;float:left;top: 12px;">区域：</p> 
         <input type="text" name="area" id="" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD; margin: 5px 10px;width: 64%;float: right;" value="{{$get['area']}}"/>
         <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px;float:left;top: 12px;">建筑：</p> 
         <input type="text" name="building" id="" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD; margin: 0px 10px;width: 64%;float: right;" value="{{$get['building']}}"/>
         <input type="submit" value="搜索" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 32px; line-height: 32px; padding: 0px; border: 0; background: #4F52BA;width: 91%; margin: 0px 10px;color:#fff;top: 5px;margin-left: 15px" /> 
        </div> 
       </form> 
       <table class="table table-bordered"> 
        <!-- <thead> 
         
        </thead>  --> 
        <tbody>
        @if(!null==$info)
         @foreach($info as $v)
         <tr> 
         </tr>
         <tr> 
          <th style="text-align: center">编号</th> 
          <th scope="row" style="text-align: center">{{$v['r_id']}}</th>
         </tr> 
         <tr> 
          <th style="text-align: center">房间名称</th> 
          <td style="text-align: center">{{$v['r_name']}}</td>
         </tr> 
         <tr> 
          <th style="text-align: center">所属建筑</th> 
          <td style="text-align: center">{{$v['b_name']}}</td>
         </tr> 
         <tr> 
          <th style="text-align: center">所属区域</th> 
          <td style="text-align: center">{{$v['a_name']}}</td>
         </tr> 
         <tr> 
          <th style="text-align: center">所在楼层</th> 
          <td style="text-align: center">{{$v['r_floor']}}</td>
         </tr> 
         <tr> 
          <th style="text-align: center">负责人</th> 
          <td style="text-align: center">{{$v['mma_username']}}</td>
         </tr>
         @if($get['ag'] == Cookie::get('agentId') || Cookie::get('agentId') == 1)
         <tr> 
          <th style="text-align: center">操作</th> 
          <td style="text-align: center">
           <a href="/admin/room/edit?r_id={{$v['r_id']}}">修改</a>|<a href="/admin/room/delete?id={{base64_encode($v['r_id'])}}">删除</a></td>
         </tr>
         @endif
         @endforeach
        @endif
        </tbody> 
       </table>
       @if(!null == $data)
        <div style="float:right;">
         {!! $data->appends($request)->render() !!}
        </div>
       @endif
      </div> 
     </div>
@endsection